/*
泛型接口
*/
var User = /** @class */ (function () {
    function User(name, age) {
        this.name = name;
        this.age = age;
    }
    return User;
}());
var UserCRUD = /** @class */ (function () {
    function UserCRUD() {
        this.data = [];
    }
    UserCRUD.prototype.add = function (user) {
        user.id = Date.now();
        this.data.push(user);
        return user.id;
    };
    UserCRUD.prototype.getById = function (id) {
        return this.data.find(function (item) { return item.id === id; });
    };
    return UserCRUD;
}());
var userCRUD = new UserCRUD();
userCRUD.add(new User('A', 12));
var id = userCRUD.add(new User('B', 13));
console.log(userCRUD.data);
console.log(userCRUD.getById(id));
